import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '@/pages/Index.vue'
import Revise from '@/pages/Revise.vue'
import EgHome from '@/pages/EgHome.vue'
import Eg from '@/pages/Eg.vue'
import Math from '@/pages/Math.vue'
import MathHome from '@/pages/MathHome.vue'
import CnHome from '@/pages/CnHome.vue'
import Cn from '@/pages/Cn.vue'
import MyStudy from '@/pages/MyStudy.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'index',
    redirect: '/index'
  },
  {
    path: '*',
    name: '404',
    redirect: '/home'
  },
  {
    path: '/eghome',
    name: 'eghome',
    component: EgHome
  },
  {
    path: '/eg',
    name: 'eg',
    component: Eg
  },
  {
    path: '/revise',
    name: 'revise',
    component: Revise
  },
  {
    path: '/index',
    name: 'index',
    component: Index
  },
  {
    path: '/math',
    name: 'math',
    component: Math
  },
  {
    path: '/mathhome',
    name: 'mathhome',
    component: MathHome
  },
  {
    path: '/cnhome',
    name: 'cnhome',
    component: CnHome
  },
  {
    path: '/cn',
    name: 'cn',
    component: Cn
  },
  {
    path: '/mystudy',
    name: 'mystudy',
    component: MyStudy
  }
  // {
  //   path: '/about',
  //   name: 'about',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
